<header id="topbar" class="">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="#stats/transaction/">用户交易流水</a>
            </li>
        </ol>
    </div>
    <div class="topbar-right">
        <a href="#" class="btn btn-default btn-sm light fw600 ml10" id="exportData"><span class="glyphicon glyphicon-cloud-download pr5"></span>导出数据</a>
        <div class="ml15 ib va-m" id="toggle_sidemenu_r">
            <a href="#" class="pl5"> <i class="fa fa-sign-in fs22 text-primary"></i>
            </a>
        </div>
    </div>
</header>

<section id="content" class="animated fadeIn">
    <% if(items.length>0){ %>
    <div class="panel overflow">
        <table class="table table-striped fs13" id="main-list">
            <thead>
                <tr class="bg-light">
                    <th class="sortable" data-field="id">ID</th>
                    <th class="sortable" data-field="created_at">时间</th>
                    <th>种类</th>
                    <th>名称</th>
                    <th class="sortable" data-field="price">金额</th>
                    <th>用户余额</th>
                    <th>状态</th>
                    <th>订单编号</th>
                    <th>充值编号</th>
                </tr>
            </thead>
            <tbody class="admin-form">
                <% _.each(items, function(item){ %>
                    <tr data-id="<%= item.id %>" >
                        <td><%= item.id %></td>
                        <td><%= item.created_at %></td>
                        <% if(item.price>0){%>
                        <td>收入</td>
                        <%}else{ %>
                        <td>支出</td>
                        <%}%>
                        <td><%= item.title %></td>
                        <td><%= item.amount %></td>
                        <td><%= item.balance %></td>
                        <td><%= TRANSACTION_STATUS[item.status] %></td>
                        <% if(item.order_id){%>
                        <td><a href="#order/<%= item.order_id %>/"><%= item.order_id %></a></td>
                        <%} else {%>
                        <td>-</td>
                        <% } %>
                        <td><%= item.pay_id || '-' %></td>
                    </tr>
                <%
                }) %>
            </tbody>
        </table>
    </div>

    <div><div class="pull-left" id="page-tips"></div><div id="paginator"></div></div>
    <% }else{ %>
    <h4 class="text-muted">无数据</h4>
    <% } %>
</section>

<!-- Start: Right Sidebar -->
<aside id="sidebar_right" class="nano">
 <div class="sidebar_right_content nano-content">
     <div class="tab-block sidebar-block br-n">
        <h4 class="mt5 text-muted fw500">过滤条件：</h4>
        <hr class="short">
        <div class="p20 admin-form">
            <div class="section mb15">
                <label for="searchUserId" class="field prepend-icon">
                    <input title="用户ID" type="text" data-field="user_id" id="searchUserId" class="gui-input" placeholder="用户ID" value="<%= searched.user_id  %>">
                    <label for="searchUserId" class="field-icon"><i class="fa fa-tag"></i>
                    </label>
                </label>
            </div>
            <h6 class="fw400">金额范围</h6>
            <div class="section row">
                <div class="col-md-6">
                        <input type="number" title="下限" name="searchPriceLower" id="searchPriceLower" class="gui-input" value="<%= searched.price_lower %>">
                </div>
                <div class="col-md-6">
                        <input type="number" title="上限" name="searchPriceUpper" id="searchPriceUpper" class="gui-input" value="<%= searched.price_upper %>">
                </div>
            </div>
            <h6 class="fw400">时间范围</h6>
            <div class="section row">
                <div class="col-md-6">
                        <input type="text" title="下限，包含当天" name="searchCreatedAtLower" id="searchCreatedAtLower" class="gui-input" data-type="date" value="<%= searched.created_at_lower %>">
                </div>
                <div class="col-md-6">
                        <input type="text" title="上限，不包括当天" name="searchCreatedAtUpper" id="searchCreatedAtUpper" class="gui-input" data-type="date" value="<%= searched.created_at_upper %>">
                </div>
            </div>
            <h6 class="fw400">种类</h6>
            <div class="section mb15">
                <label class="field select">
                    <select id="searchType" name="searchType" data-field="type">
                        <option value="0" <%= searched.price == 0 ? 'selected' : '' %>>所有</option>
                        <option value="1" <%= searched.price == 1 ? 'selected' : '' %>>收入</option>
                        <option value="-1" <%= searched.price == -1 ? 'selected' : '' %>>支出</option>
                    </select>
                    <i class="arrow double"></i>
                </label>
            </div>
            <h6 class="fw400">名称</h6>
            <div class="section mb15">
                <label class="field select">
                    <select id="searchTitle" name="searchTitle" class="m5" data-field="title" multiple>
                        <!--<option value="-1" <%= searched.title == -1 ? 'selected' : '' %>>所有</option>-->
                        <% _.each(TRANSACTION_TITLE, function(key,value){ %>
                        <option value='<%=key%>' <%= searched.title == key ? 'selected': ''%>><%= value%></option>
                        <%})%>
                    </select>
                    <i class="arrow double"></i>
                </label>
            </div>
            <hr class="short">

            <button class="btn btn-default btn-block" type="button" id="search">搜索</button>

        </div>
     </div>
 </div>

</aside>
<!-- End: Right Sidebar -->
